<!-- form表单视图 -->
<div style="margin-top:30px">
    <form class="form-horizontal common-form" id="form-save" method="post" action="/sysconf/payment/save" onsubmit="return false;" autocomplete="off">
    <input type=hidden value="{{$row['id'] ?? ''}}" name="id" id="id">
        <div class="form-group row form-item">
            <label style=" font-weight: normal" for="c-mch_name" class="control-label col-xs-12 col-sm-2">
            <span style="color:red">*</span> 支付方式：</label>
            <div class="col-xs-12 col-sm-10">
                <div class="row">
                    <select @if($row['id'] ?? '') readonly="readonly" @endif class="form-control col-sm-6 mater-cate" id="pay_type" name="pay_type" onchange="paySelect(this)">
                        @foreach($pay_type as $k=>$v)
                            <option value={{$k}} @if($k == ($row['pay_type']??-1)) selected @endif >{!! $v !!}</option>
                        @endforeach
                    </select>
                    <span class="col-sm-6 color-6A6969"> 选择支付方式名称。</span>
                </div>
                <span class="msg-box" style="position:static;" for="pay_type"></span>
            </div>
        </div>
        <div class="form-group row form-item" style="height:100px">
            <label style=" font-weight: normal" for="c-logo" class="control-label col-xs-12 col-sm-2">图标：</label>
            <div class="col-xs-12 col-sm-10">
                <div class="row">
                    <div style="padding-left: 0;" class="col-sm-6">
                        @component('component/image_upload',['upload_url' => config('common.upload_url'),'name'=>'logo','uploader'=>'uploader','direction'=>1,'browse_btn'=>'form-avatar','content_class'=>'background','img_format'=>'gif,jpg,jpeg,png','img_size'=>'100kb','num'=>1,'value'=>$row['logo']??''])
                        @endcomponent
                    </div>
                    <span class="col-sm-6 color-6A6969"> 推荐：200 * 200 PX,大小：1000K。格式：jpg / jpeg / png。</span>
                </div>
            </div>
        </div>

        <div id="alipay" style="display: @if(isset($row['pay_type']) && $row['pay_type'] == 'alipay') block @else none @endif">
            <div class="form-group row form-item">
                <label style=" font-weight: normal" for="c-app_id" class="control-label col-xs-12 col-sm-2">
                <span style="color:red">*</span> 应用appid：</label>
                <div class="col-xs-12 col-sm-10">
                    <div class="row">
                        <input  id="app_id" class="form-control col-sm-6" name="alipay[app_id]" type="text" value="{{$row['alipay']['app_id'] ?? ''}}" placeholder="" >
                        <span class="col-sm-6 color-6A6969"> 请填写支付宝应用id。</span>
                    </div>
                    <span class="msg-box" style="position:static;" for="app_id"></span>
                </div>
            </div>
            <div class="form-group row form-item">
                <label style=" font-weight: normal" for="c-private_key" class="control-label col-xs-12 col-sm-2">
                    <span style="color:red">*</span> 应用私钥：</label>
                <div class="col-xs-12 col-sm-10">
                    <div class="row">
                        <textarea class="form-control col-sm-6" name="alipay[private_key]" placeholder="">{{$row['alipay']['private_key'] ?? ''}}</textarea>
                        <span class="col-sm-6 color-6A6969"> 请填写应用私钥。</span>
                    </div>
                    <span class="msg-box" style="position:static;" for="private_key"></span>
                </div>
            </div>
            <div class="form-group row form-item">
                <label style=" font-weight: normal" for="c-public_key" class="control-label col-xs-12 col-sm-2">
                    <span style="color:red">*</span> 应用公钥：</label>
                <div class="col-xs-12 col-sm-10">
                    <div class="row">
                        <textarea class="form-control col-sm-6" name="alipay[public_key]" placeholder="">{{$row['alipay']['public_key'] ?? ''}}</textarea>
                        <span class="col-sm-6 color-6A6969"> 请填写应用公钥。</span>
                    </div>
                    <span class="msg-box" style="position:static;" for="public_key"></span>
                </div>
            </div>
            <div class="form-group row form-item">
                <label style=" font-weight: normal" for="c-alipay_public_key" class="control-label col-xs-12 col-sm-2">
                    <span style="color:red">*</span> 支付宝公钥：</label>
                <div class="col-xs-12 col-sm-10">
                    <div class="row">
                        <textarea class="form-control col-sm-6" name="alipay[alipay_public_key]" placeholder="">{{$row['alipay']['alipay_public_key'] ?? ''}}</textarea>
                        <span class="col-sm-6 color-6A6969"> 请填写支付宝公钥。</span>
                    </div>
                    <span class="msg-box" style="position:static;" for="alipay_ppublic_key"></span>
                </div>
            </div>
        </div>
        <div id="wechat" style="display: @if(isset($row['pay_type']) && $row['pay_type'] == 'wechat') block @else none @endif">
            <div class="form-group row form-item">
                <label style=" font-weight: normal" for="c-mch_id" class="control-label col-xs-12 col-sm-2">商户号：</label>
                <div class="col-xs-12 col-sm-10">
                    <div class="row">
                        <input  id="mch_id" class="form-control col-sm-6" name="wechat[mch_id]" type="text" value="{{$row['wechat']['mch_id']??''}}" placeholder="" >
                        <span class="col-sm-6 color-6A6969"> [MCHID]微信支付商户号</span>
                    </div>
                    <span class="msg-box" style="position:static;" for="mch_id"></span>
                </div>
            </div>
            <div class="form-group row form-item">
                <label style=" font-weight: normal" for="c-signkey" class="control-label col-xs-12 col-sm-2">密钥：</label>
                <div class="col-xs-12 col-sm-10">
                    <div class="row">
                        <input  id="signkey" class="form-control col-sm-6" name="wechat[signkey]" type="text" value="{{$row['wechat']['signkey']??''}}" placeholder="" >
                        <span class="col-sm-6 color-6A6969"> [MCHID]微信支付商户号</span>
                    </div>
                    <span class="msg-box" style="position:static;" for="signkey"></span>
                </div>
            </div>
            <div class="form-group row form-item">
                <label style=" font-weight: normal" for="c-mch_name" class="control-label col-xs-12 col-sm-2">证书cert：</label>
                <div class="col-xs-12 col-sm-10">
                    <div class="row" >
                       <span class="col-sm-5" style="padding-left: 0;padding-right: 0">
                            <button id="upload_file_btn" data-value="1" type="button" style="width: 65px;height: 25px;background-color: #dcdcdc;border: 1px solid #a9a9a9">选择文件</button>
                            <input hidden name='wechat[cert_path]' class="path_value" value="{{$row['wechat']['cert_path']??''}}" />
                            <input id="cert_path" accept=""  style='position:relative;left:-65px;opacity:0;width:65px;' type='file' class="col-sm-5" onchange="fileupload(this,1)">
                        <span style="position:relative;left:-55px;@if(!isset($row['wechat']['cert_path'])) display: none;@endif color:lightgreen" class="uploaded">已上传</span>
                       </span>
                    </div>
                    <span class="msg-box" style="position:static;" for="sslcert_path" id="message"></span>
                </div>
            </div>
            <div class="form-group row form-item">
                <label style=" font-weight: normal" for="c-key_path" class="control-label col-xs-12 col-sm-2">证书key：</label>
                <div class="col-xs-12 col-sm-10">
                    <div class="row" >
                        <span class="col-sm-5" style="padding-left: 0;padding-right: 0">
                            <button id="upload_file_btn" data-value="1" type="button" style="width: 65px;height: 25px;background-color: #dcdcdc;border: 1px solid #a9a9a9">选择文件</button>
                            <input hidden name='wechat[key_path]' class="path_value" value="{{$row['wechat']['key_path']??''}}" />
                            <input id="key_path" accept=""  style='position:relative;left:-65px;opacity:0;width:65px;' type='file' class="col-sm-5" onchange="fileupload(this,1)">
                            <span style="position:relative;left:-55px;@if(!isset($row['wechat']['key_path'])) display: none;@endif;color:lightgreen" class="uploaded">已上传</span>
                        </span>
                    </div>
                    <span class="msg-box" style="position:static;" for="key_path" id="message"></span>
                </div>
            </div>
        </div>

        <div class="form-group row form-item">
            <label style=" font-weight: normal" for="c-poundage" class="control-label col-xs-12 col-sm-2">手续费：</label>
            <div class="col-xs-12 col-sm-10">
                <div class="row">
                    <input  id="poundage" class="form-control col-sm-6" name="poundage" type="text" value="{{$row['poundage']??''}}" placeholder="0.4" >
                    <span class="col-sm-6 color-6A6969"> 支付方式手续费,按百分比，如果填1，则表示1%。</span>
                </div>
                <span class="msg-box" style="position:static;" for="poundage"></span>
            </div>
        </div>
        <div class="form-group row form-item">
            <label style=" font-weight: normal" for="c-desc" class="control-label col-xs-12 col-sm-2">
                 描述：</label>
            <div class="col-xs-12 col-sm-10">
                <div class="row">
                    <textarea class="form-control col-sm-6" name="desc" placeholder="">{{$row['desc'] ?? ''}}</textarea>
                    <span class="col-sm-6 color-6A6969"> 支付方式措述。</span>
                </div>
                <span class="msg-box" style="position:static;" for="desc"></span>
            </div>
        </div>

    </form>
    <div class="form-group layer-footer">
        <label class="control-label col-xs-12 col-sm-2"></label>
        <div class="col-xs-12 col-sm-8">
            <button type="submit" class="btn btn-primary btn-3F51B5 btn-sure btn-submit">确定</button>
            &nbsp;&nbsp;&nbsp;&nbsp;
            <button type="reset" class="btn btn-write btn-reset">重置</button>
        </div>
    </div>
</div>

